import request from "@/utils/request";

interface KOLListParams {
  current?: number,
  pageSize?: number,
  name?: string,
  status?: number,
}
export const getKOL = (params: KOLListParams) => {
  return request({
    url: "/api/kol/queryList",
    method: "get",
    params
  })
}
interface updateKOLStatusParams {
  id?: number,
  status?: number,
}
export const updateKOLStatus = (data: updateKOLStatusParams) => {
  return request({
    url: "/api/kol/updateStatus",
    method: "post",
    data
  })
}
interface updateKOLParams {
  id?: number,
  status?: number,
}
export const updateKOL = (data: updateKOLParams) => {
  return request({
    url: "/api/kol/update",
    method: "post",
    data
  })
}

interface addKOLParams {
  email?: string,
  name?: string,
  rate?: number,
  account?: string,
  link?: string,
  dashboard?: string,
  extra?: string,
  status?: number,
  create_by?: string,
}
export const addKOL = (data: addKOLParams) => {
  return request({
    url: "/api/kol/add",
    method: "post",
    data
  })
}
interface deleteKOLParams {
  id?: number,
}
export const deleteKOL = (data: deleteKOLParams) => {
  return request({
    url: "/api/kol/delete",
    method: "post",
    data
  })
}